package com.github.prontera.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.prontera.ApiVersion;
import com.github.prontera.RequestLogging;
import com.github.prontera.common.filter.IgnoreAuth;
import com.github.prontera.domain.AppBanner;
import com.github.prontera.domain.enums.YesOrNoEnum;
import com.github.prontera.model.response.ObjectDataResponse;
import com.github.prontera.service.AppBannerService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * Banner
 */
@RestController
@Api(value = "Banner")
@RequestMapping(value = ApiVersion.API_V1_PREFIX+"/banner")
public class AppBannerController{

	@Autowired
	private AppBannerService appBannerService;
	
	
	/**
	 * 获取Banner
	 */
	
	@IgnoreAuth
	@RequestMapping(value = "find", method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation(value = "获取Banner" , notes = "获取Banner")
	public ObjectDataResponse<List<AppBanner>> find(){
		AppBanner appBanner=new AppBanner();
		appBanner.setStatus(YesOrNoEnum.YES);
		List<AppBanner> appBanners=	appBannerService.find(appBanner);
		return new ObjectDataResponse<List<AppBanner>>(appBanners);
	}
	
}
